package poker;
import javax.swing.*;
import java.awt.*;

public class KaartMidGUI extends JPanel
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Color backGround = new Color(0, 128, 0);		// groen zoals poker tafel
	
	public boolean drawDealerButton = false;
	protected Kaart[] krt = new Kaart[5];
	
	public KaartMidGUI()
	{
		setBackground( backGround );
		setPreferredSize(new Dimension(600, 100));
		setMinimumSize(new Dimension(600, 100));
	}
	
	public void paintComponent(Graphics g)
	{
		////System.out.println("KaartMidGUI: krt[0] = " + krt[0]);
		
		g.setColor( backGround );
		g.fillRect(0, 0, getWidth(), getHeight() );
		
		g.setColor(Color.BLACK);
		if(krt[0]!=null)
			g.drawImage(krt[0].getImage(), 120, 10, 72, 96, backGround, this);
		if(krt[1]!=null)
			g.drawImage(krt[1].getImage(), 200, 10, 72, 96, backGround, this);
		if(krt[2]!=null)
			g.drawImage(krt[2].getImage(), 280, 10, 72, 96, backGround, this);
		if(krt[3]!=null)
			g.drawImage(krt[3].getImage(), 360, 10, 72, 96, backGround, this);
		if(krt[4]!=null)
			g.drawImage(krt[4].getImage(), 440, 10, 72, 96, backGround, this);
		
		if(drawDealerButton)
		{
			g.setColor(Color.RED);
			g.fillOval(2, 41, 15, 15);
			g.setColor(Color.YELLOW);
			g.drawString("D", 7, 53);
		}
	}
}